import { Global, Module } from '@nestjs/common'
import { TypeOrmModule } from '@nestjs/typeorm'
import { Role } from './entities/role.entity'
import { Permission } from './entities/permission.entity'
import { UserRole } from './entities/user-role.entity'
import { RbacService } from './services/rbac.service'
import { RbacController } from './controllers/rbac.controller'

@Global()
@Module({
  imports: [TypeOrmModule.forFeature([Role, Permission, UserRole])],
  providers: [RbacService],
  controllers: [RbacController],
  exports: [RbacService],
})
export class RbacModule {}
